#!/bin/sh

if [ $# = 1 ]; then
    modules="packages/$1/"
else
    modules="packages/*/"
fi

mkdir -p ae-docs/input ae-docs/markdown

for m in $modules; do
    echo "$m"
    cp "$m"/.ae/doc/*.api.json ae-docs/input/
done

(cd ae-docs && ../node_modules/.bin/api-documenter markdown)
